package com.DreamTeam.dbc;

import java.io.IOException;

import javax.imageio.IIOException;

public class db_deal {       
    private static String str=null;       
    public static boolean backup(String path){
            str="c:\\mysqldump --no-defaults -u root -proot szplss525 > "+path;    
            try {  
                    Runtime rt=Runtime.getRuntime();
                    rt.exec("cmd /c"+str);
                    return true;
            } catch (IOException e) {  
                    e.printStackTrace();  
                    return false;             
        
            }  
            
    }
    
    public static boolean resore(String path){
            str="c:\\mysql --no-defaults -u root -proot szplss525  <  "+path;
            Runtime rt=Runtime.getRuntime();
            try {
                    rt.exec("cmd /c"+str);
                    return true;
            } catch (IOException e) {
                    e.printStackTrace();
                   return false;
            }
    }
}